package com.ricchieri.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.springframework.cache.annotation.Cacheable;

import com.ricchieri.dao.interf.ICharterExpenseTypeDao;
import com.ricchieri.filter.BasicFilter;
import com.ricchieri.model.CharterExpenseType;

public class CharterExpenseTypeDao extends GenericDao implements ICharterExpenseTypeDao {
	private static final long serialVersionUID = 895803046916188759L;

	@Override
	@Cacheable(value="charterExpenseType")
	@SuppressWarnings("unchecked")
	public List<CharterExpenseType> getAllCharterExpenseTypes(BasicFilter filter) {
		Criteria criteria = criteriaAllCharterExpenseType(filter);
		
		return criteria.list();
	}
	
	private Criteria criteriaAllCharterExpenseType(BasicFilter filter) {
		return super.criteriaAllBasic(filter, CharterExpenseType.class);
	}	
	
	@Override
	protected String getTableName() {
		return "charterExpenseType";
	}
}
